package cn.imokay.springboot.profile.controller;

import cn.imokay.springboot.profile.configmodel.IpPortModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableConfigurationProperties(IpPortModel.class)
public class HelloController {

    @Autowired
    private IpPortModel ipPort;

    @RequestMapping("hello1")
    public String hello1(){
        System.out.println(ipPort);
        return ipPort.toString();
    }
}
